package com.example.footprint;

import java.util.ArrayList;

import android.content.Context;
import android.graphics.drawable.Drawable;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;

public class MessagesOverlay extends ItemizedOverlay{

	private ArrayList<MessageItem> msmOverlayList = new ArrayList<MessageItem>();
	private Context mContext;
	
	public MessagesOverlay(Drawable drawable) {
		super(boundCenterBottom(drawable));
		// TODO Auto-generated constructor stub
	}
	
	public MessagesOverlay(Drawable drawable, Context context) {
		this(drawable);
		mContext = context;
	}
	
	public void addItem(MessageItem item) {
		msmOverlayList.add(item);
		this.populate();
	}
	
	@Override
	protected OverlayItem createItem(int index) {
		// TODO Auto-generated method stub
		return msmOverlayList.get(index);
	}

	@Override
	public int size() {
		// TODO Auto-generated method stub
		return msmOverlayList.size();
	}

	@Override
	protected boolean onTap(int index) {
		// TODO Auto-generated method stub
		MessageItem msmItem = msmOverlayList.get(index);
		//send the ID to server and get the details
		//create a new activity to display the detailed message
		return true;
	}
	
	

}
